//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
//////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2003 Intrinsyc Europe Ltd.
//////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2004 Siemens AG
//
// Version: 1.1.2.5
// Date:    11. Jan. 2006
//////////////////////////////////////////////////////////////////////////////


#pragma once

//
#define MAX_DRIVERINIT_TIME    10000

// Max length of AT commands and responses
#ifdef RIL_ENABLE_SIMTK
#define MAX_ATCMD_LEN           1016
#else // RIL_ENABLE_SIMTK
#define MAX_ATCMD_LEN            816
#endif // RIL_ENABLE_SIMTK

// Check compiler flag dependencies
#ifdef AUXCOM_PORT
#ifdef DUAL_PORT_SERIAL
#error It is not possible to build a dual UART version if the 3rd mux port shall be used!
#endif
#endif

// Globals
extern CRITICAL_SECTION g_csClosing;
extern HANDLE g_hCriticalErrorEvent;
extern HANDLE g_hNewDialOrHangupEvent;
extern DWORD g_dwReadyState;
extern DWORD g_dwRegStatus;
extern DWORD g_dwGPRSRegStatus;

// Functions
HRESULT RILDrv_GetNextNotification(DWORD dwParam, RILDRVNOTIFICATION* lpRilDrvNotification);
HRESULT RILDrv_GetSerialPortStatistics(DWORD dwParam, RILSERIALPORTSTATS* lpSerialPortStats);
HRESULT RILDrv_SetPowerState(DWORD dwParam, CEDEVICE_POWER_STATE PowerState);
BOOL ClearCmdHandle(void* pItem, DWORD dwDummy);
CRilInstanceHandle* const ExtractHandle(const DWORD dwParam, BOOL bOverrideEmergency = FALSE);


#ifdef SIGNAL_CRITICAL_ERROR_CALLS_RS
void SignalCriticalError(DWORD dwEventId, DWORD dwLineNum, char *lpszFileName);
#define SignalCriticalError(AA_) SignalCriticalError(AA_, __LINE__, __FILE__)
#else
void SignalCriticalError(DWORD dwEventId);
#endif

